<?php

class ProductAccount extends DataObject {
    private static $singular_name = "E-Product Account";
    private static $plural_name = "E-Product Accounts";
    
    private static $extensions = array("Account");

    static function create_statement($data, $memberid) {
        if( !$memberid) {
            throw new Exception("Empty memberid");
        }
        return ProductAccount::create()
        ->update($data)
        ->setField('MemberID', $memberid)
        ->write();
    }

    static function delete_statement($id) {
        if(!$id) {
            throw new Exception("Empty ID");
        }
        ProductAccount::delete_by_id('ProductAccount', $id);
    }

    function canView($member = false) {
        return true;
    }

    function canEdit($member = false) {
        return false;
    }

    function canDelete($member = false) {
        return false;
    }

    function canCreate($member = false) {
        return false;
    }
}
?>